package cn.eonshine.cuba.inf.modular.quartz.service;

import java.util.List;

import org.quartz.SchedulerException;

import com.baomidou.mybatisplus.extension.service.IService;

import cn.eonshine.cuba.inf.modular.quartz.entity.Config;

public interface IQuartzTableService extends IService<Config> {

	public List<Config> getAllJobs();
	/**
	 * 
	 * @Title: update   
	 * @Description: 启用或禁用任务 
	 * by Alan 2019-06-26 18:54:06
	 * 
	 * @param id primary key of the job in database
	 * @param status 0-disable 1-enable
	 * @return true or false
	 * @throws Exception Scheduler Exception
	 */
	public boolean update(String id, String status, String idUpdator) throws Exception;

	/**
	 * 
	 * @Title: startJobs   
	 * @Description: 启动所有的任务 
	 * by Alan 2019-06-26 18:54:16      
	 */
	public void startJobs();

	/**
	 * 
	 * @Title: updateCron   
	 * @Description: 修改cron表达式 
	 * by Alan 2019-06-26 18:54:25
	 * 
	 * @param id primary key of the job in database
	 * @param cronSchedule Schedule expression
	 */
	public void updateCron(String id, String cronSchedule);
	
	/**
	 * 
	 * @Title: pauseJob   
	 * @Description: pause Job   
	 * by Alan 2019-06-26 18:54:35
	 * 
	 * @param config  configuration
	 * @return true or false
	 * @throws SchedulerException Scheduler Exception
	 */
	public boolean pauseJob(Config config) throws SchedulerException;
	/**
	 * 
	 * @Title: resumeJob   
	 * @Description: resume Job  
	 * by Alan 2019-06-26 18:54:45
	 * 
	 * @param config configuration
	 * @return true or false
	 * @throws SchedulerException Scheduler Exception
	 */
	public boolean resumeJob(Config config) throws SchedulerException;

}